/** 关于融合通讯的方法 */
import { COMMUNICATE_PREFIX_URL } from "@/config/global.js";


/**
 * 获取设备的直播视频
 * @param params {{ caller: string, callee: string, token: string }}
 * 字段注释：
 * caller: 主叫号码,
 * callee: 被叫号码,
 * token: (主叫号码 + 主叫号码密码),
 * */
export const getDeviceLiveVideo = (params = {}) => {
    return new Promise(resolve => {
		uni.request({
			url: COMMUNICATE_PREFIX_URL + "v1/live/push/start",
			method: "POST",
			data: params,
			success: res => {
				const { data, state }  = res.data;
				
				if(state === "200") {
					resolve(data);
				}
				else {
					resolve(data);
				}
			},
		});
    });
}


